<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'data_digest.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery.md5.js"></script>
  </head>
  
  <body>logistics_interface
    	<h1>数据请求加校验</h1>
    	<p>约定数字签名为:test</p>
    	<form action="DataDigestServlet" method="POST">
    		<textarea rows="10" cols="40" name="data"><order></order></textarea>
    		<input type="hidden" name="logistics_interface"/>
    		<input type="hidden" name="data_digest"/><br>
    		<input type="button" value="提交"/>
    	</form>
  </body>
  <script type="text/javascript">
	$(function(){
		$("input[type='button']").click(function(){
			var src = $("textarea").val();
			$("input[name='logistics_interface']").val(encodeURIComponent(src));
			$("input[name='data_digest']").val($.md5(encodeURIComponent(src)+"test"));
			$("form").submit();
		});
	});	
  </script>
</html>
